 
/*
class Cat extends Dog{

}*/
/*
class Animal{
    public String name;
    public int age;

    public Animal(String name,int age){
        this.name = name;
        this.age = age;
    }

    public void eat(){
        System.out.println(this.name + " ");
    }
}

class Dog extends Animal{
    public Dog(String name,int age){
        super(name,age);
    }

    public void bark(){
        System.out.println(this.name + "汪汪叫 ");
    }
}

class Cat extends Animal{
    public Cat(String name,int age){
        super(name,age);
    }

    public void miaomiao(){
        System.out.println(this.name + "喵喵叫 ");
    }
}


public class test {
    public static void main(String[] args) {
        Animal dog = new Dog("远远",19);
        dog.eat();

        Dog dog1 = (Dog)dog;

        // Cat cat = (Cat)dog;
        // cat.miaomiao();

        dog1.bark();

        // dog.name = "小小";
        // System.out.println(dog.name);
        // dog.eat();


       // Animal animal = new Dog("小白",3);
    }
}*/
/*
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int x = scanner.nextInt();
            int y = scanner.nextInt();
            int z = scanner.nextInt();
            Sub sub = new Sub(x, y, z);
            System.out.println(sub.calculate());
        }
    }

}*/

/*
class Base {

    private int x;
    private int y;

    public Base(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

}

class Sub extends Base {

    private int z;

    public Sub(int x, int y, int z) {
        super(x,y);
        this.z = z;
    }

    public int getZ() {
        return z;
    }

    public int calculate() {
        return super.getX() * super.getY() * this.getZ();
    }

}
*/
/*
public class Person{

    private String name = "Person";

    int age=0;

}

public class Child extends Person{

    public String grade;

    public static void main(String[] args){

        Person p = new Child();

        System.out.println(p.name);

    }

}*/

class Shape {
    public void draw() {
        System.out.println("画图");
    }
}

class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("⬜");
    }
}

class Cycle extends Shape {
    @Override
    public void draw() {
        System.out.println("⚪");
    }
}

class Flower extends Shape {
    @Override
    public void draw() {
        System.out.println("❀");
    }
}

class Test2 {
    public static void drawShapes() {
        Rect rect = new Rect();
        Cycle cycle = new Cycle();
        Flower flower = new Flower();
        String[] shapes = {"cycle","rect","cycle","rect","flower"};

        for(String shape : shapes) {
            if(shape.equals("cycle")) {
                cycle.draw();
            }else if (shape.equals("rect")) {
                rect.draw();
            }else{
                flower.draw();
            }
        }
    }

    public static void main(String[] args) {
        drawShapes();
    }
}
